import { useGet } from '@/utils/request'; // 确认路径是否正确

/**
 * 获取用户提交统计信息 (热力图数据)
 * @param params - 查询参数 (period 或 startDate/endDate)
 */
export const getSubmissionStatsApi = (params: API.SubmissionStatsParams) => {
  // 后端接口返回的是 BaseResponse<DailySubmissionStat[]>
  return useGet<API.DailySubmissionStat[]>('/statistic/submission-stats', params);
};

/**
 * 获取积分排行榜
 * @param params 
 * @returns 
 */
export const getScoreRankApi = (params: API.ScoreRankParams) => {
  return useGet<API.UserRankVo[]>('/statistic/score-rank', params);
};

/**
 * 获取热门题目
 * @param params 
 * @returns 
 */
export const getHotProblemsApi = (params: API.HotProblemParams) => {
  return useGet<API.HotProblemVo[]>('/statistic/hot-problems', params);
};